Skip to content

fix: performance API docs, trend is null when the previous period is 0 - #151

Merged
sonpiaz merged 1 commit into
mainfrom
docs/performance-trend-null
Oct 17, 2026
Merged

sonpiaz merged 1 commit into
mainfrom
docs/performance-trend-null

Conversation

@sonpiaz

@sonpiaz sonpiaz commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

What changed

api-reference/performance.mdx: trend object table (trend is a number or null, new previous), the zero-previous rule, the rounding-to-stable rule, example JSON (values consistent: clicks 60 vs 52 gives 15.4 up; previous-0 metrics give null up), and last_updated.

Why

cms#510 (merge 2bfb463, tag v3.16.114, live) changes the period trend: growth from a previous value of 0 has no percentage (null, was 100), and each trend object now carries previous.

How verified

  • affiliate-cms v3.16.114:src/utils/trend.ts periodTrend: previous 0 gives percentage: current === 0 ? 0 : null, direction by sign; otherwise the change is rounded to 0.1 first and the direction comes from the rounded change.
  • v3.16.114:src/api/affiliate-tracking/controllers/affiliate-tracking.ts:817-821: calculateTrend returns { trend: percentage, trendDirection: direction, previous } for all 7 trends (route /tracking/performance/:programId, routes file line 30).
  • No other docs mention trendDirection (grep over content and public).
  • Build, check-agent-surface, check-docs-host and check-docs-host-http pass locally. No media.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
affitor-docs Ready Ready Preview Oct 17, 2026 5:01am UTC

Request Review

@sonpiaz
sonpiaz merged commit 713d443 into main Oct 17, 2026
3 checks passed
@sonpiaz
sonpiaz deleted the docs/performance-trend-null branch October 17, 2026 05:04

This branch was successfully deployed

1 active deployment
Preview — 9ed78063 Deployed Oct 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant